home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / raytrace / pov / gen / accel / read.me < prev   
Text File  |  1991-06-16  |  5KB  |  204 lines

  1. I must apologize in advance for the clarity of these docs.  Today I feel
  2. as if English is my second (or Forth, perhaps) language...
  3.  
  4. I wanted to generate a bouncing ball with DKB and TGAFLI... I tried out
  5. the excellent ANIMA program by Dan Farmer, but it only allowed me linear
  6. motion... not sufficient for gravity or collisions.  Thus the following
  7. very rudimentary utilities:
  8.  
  9. ACCEL:   Generate position table.
  10.  
  11. MRGDATA: Make multiple .DAT files, replacing a variable with line from
  12.          position table.
  13.  
  14.  
  15. ACCEL SYNTAX:
  16.  
  17.    ACCEL <ScriptFileName> [SkipFrames] > TableName
  18.  
  19. (ACCEL.EXE writes the position table to standard output).
  20.  
  21. Since ACCEL is quantized, it is often more accurate to specify a
  22. multiple number of frames to be calculated for each line emitted.  The
  23. default SkipFrames is 1, or emit for each calculated frame.  The same
  24. number of lines will be emitted regardless of SkipFrame value, but
  25. the higher the value the more intermediate calculations.
  26.  
  27.  
  28. ACCEL COMMANDS:
  29.  
  30.  
  31. ACCELERATION <Magnitude> < x y z direction vector>
  32.  
  33. Applies a constant acceleration to object in the x y z direction. This
  34. is good for gravity in a flat world.  See ACCEL.BAL.
  35.  
  36. Set to 0.0 magnitiude for simple velocity and camera dolly.
  37.  
  38.  
  39. ACCELP <Magnitude> <Radius> < x y z point>
  40.  
  41. Applies a gravity-like acceleration to the object from a point source
  42. at X Y Z.  The radius is that at which the acceleration is equal to the
  43. magnitude.  You can use this to plot orbits.  see ACCEL.ORB.
  44.  
  45.  
  46. BOUNCEX/BOUNCEY/BOUNCEZ <value> <efficiency>
  47.  
  48. Reverses the X, Y, or Z velocity vector when the position crosses VALUE
  49. on the X, Y, or Z axis.  Efficiency is a factor reflecting elasticity.
  50. If it is set to 1.0, all velocity in that direction will be reversed.
  51. You may have a bounce value for each of the three axes active at once.
  52. See ACCEL.BAL.
  53.  
  54.  
  55. FRAMESPERSECOND   <value>
  56.  
  57. Divisor for acceleration changes to velocity and velocity changes to
  58. position.
  59.  
  60.  
  61. STARTPOSITION  < x y z vector>
  62.  
  63. Initial position of object, will be first line of output.
  64.  
  65.  
  66. STARTVELOCITY  < x y z vector>
  67.  
  68. Initial velocity of object.
  69.  
  70.  
  71. TOTALFRAMES
  72.  
  73. Number of positions to generate.
  74.  
  75.  
  76. ACCEL will ignore lines beginning with a semi-colon, so you can
  77. add comments to your script.
  78.  
  79.  
  80. MRGDATA SYNTAX:
  81.  
  82.   MRGDATA BaseName VariableName TableName
  83.  
  84. where BaseName is the base file name of the initial .DAT, 
  85. VaribleName is the Variable to replace (CASE SENSITIVE!), and
  86. TableName is the file with the variables values.
  87.  
  88. MRGDATA will create a .DAT for each line in the table.  Only one
  89. variable can be replaced.
  90.  
  91.  
  92. EXAMPLE:
  93.  
  94. Using the file ACCEL.SCR:
  95.  
  96. ACCELERATION      9.8   0.0   -1.0  0.0
  97. FRAMESPERSECOND   5.0
  98. TOTALFRAMES       15
  99. STARTPOSITION     0.0   50.0    0.0
  100. STARTVELOCITY     0.0   0.0     5.0
  101. BOUNCEY  0.0   0.9
  102.  
  103.  
  104. generates a table for a ball dropping from 50.0 units, and bouncing
  105. on the XZ plane at Y=0.0.  90% of the energy is returned from the
  106. collision.  The ball is initially traveling into the Z direction at
  107. 5 units/second.
  108.  
  109. ACCEL ACCEL.SCR > ACCEL.OUT
  110.  
  111. The resulting table ACCEL.OUT is:
  112.  
  113. 0.000000 50.000000 0.000000
  114. 0.000000 48.775000 2.500000
  115. 0.000000 45.100000 5.000000
  116. 0.000000 38.975000 7.500000
  117. 0.000000 30.400000 10.000000
  118. 0.000000 19.375000 12.500000
  119. 0.000000 5.900000 15.000000
  120. 0.000000 0.000000 17.500000
  121. 0.000000 14.210000 20.000000
  122. 0.000000 25.970000 22.500000
  123. 0.000000 35.280000 25.000000
  124. 0.000000 42.140000 27.500000
  125. 0.000000 46.550000 30.000000
  126. 0.000000 48.510000 32.500000
  127. 0.000000 48.020000 35.000000
  128.  
  129.  
  130. Now apply the ACCEL.OUT to AT2.DAT (note the variable SphereLoc):
  131.  
  132. INCLUDE "shapes.dat"
  133. INCLUDE "colors.dat"
  134. INCLUDE "textures.dat"
  135.  
  136. VIEW_POINT
  137.    LOCATION <0.0  20.0  -100.0>
  138.    DIRECTION <0.0 0.0  1.0>
  139.    UP  <0.0  1.0  0.0>
  140.    RIGHT <1.33333 0.0 0.0>
  141. END_VIEW_POINT
  142.  
  143. OBJECT
  144.    PLANE <0.0 1.0 0.0> -10.0 END_PLANE
  145.    COLOUR White
  146.    TEXTURE
  147.       COLOUR White
  148.       AMBIENT 0.2
  149.       DIFFUSE 0.8
  150.    END_TEXTURE
  151. END_OBJECT
  152.  
  153. OBJECT
  154.    SPHERE <SphereLoc>  40.0 END_SPHERE
  155.  
  156.    TEXTURE
  157.       COLOUR Red
  158.    END_TEXTURE
  159. END_OBJECT
  160.  
  161. OBJECT
  162.    SPHERE <0.0  0.0  0.0>  2.0 END_SPHERE
  163.    TRANSLATE <100.0  120.0  40.0>
  164.    TEXTURE
  165.       COLOUR White
  166.       AMBIENT 1.0
  167.       DIFFUSE 0.0
  168.    END_TEXTURE
  169.    LIGHT_SOURCE
  170.    COLOUR White
  171. END_OBJECT
  172.  
  173.  
  174. The syntax is:
  175.  
  176. MRGDATA AT2 SphereLoc ACCEL.OUT
  177.  
  178.  
  179. This generates files AT2001.dat through AT2015.DAT, which have the
  180. value SphereLoc replaced with the entry from the ACCEL.OUT table.
  181.  
  182. You can replace any string with the value from the table.  If you
  183. wish to embed spaces in the source string, surround variablename
  184. with quotes:
  185.  
  186. MRGDATA AT2 "COLOUR White" ACCEL.OUT
  187.  
  188.  
  189. MRGDATA will ignore lines beginning with a semi-colon, so you can
  190. add comments to your table.
  191.  
  192.  
  193. Remember:
  194.  
  195. Use the SkipFrames parameter to oversample the motion.  This helps
  196. accuracy, especially in the bounces.  (Bounces force the object to
  197. the bounce value, and so the resulting velocity may be too great for
  198. that location.  In the example above, the ball bounced back with more
  199. than 90% of its energy because of quantization error).
  200.  
  201.  
  202. ...John M. Trindle, June 1991
  203. (you can reach me on "You can call me Ray")
  204.